local jufen = fk.CreateSkill {
  name = "th_jufen",
}

jufen:addEffect("active", {
  anim_type = "offensive",
  card_num = 1,
  prompt = "#th_jufen",
  card_filter = function(self, player, to_select, selected)
    return #selected == 0
  end,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player and not to_select.chained
  end,
  target_num = 1,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:throwCard(effect.cards, jufen.name, player, player)
    target:setChainState(true, {
      who = player,
      reason = jufen.name
    })
    room:addPlayerMark(player, "th_jufen-phase", 1)
  end
})
jufen:addEffect(fk.EventPhaseEnd, {
  is_delay_effect = true,
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return player:getMark("th_jufen-phase") ~= 0
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player:setChainState(true, {
      who = player,
      reason = jufen.name
    })
    player.room:damage{
      from = player,
      to = player,
      damage = 1,
      skillName = jufen.name,
      damageType = fk.FireDamage
    }
  end
})

Fk:loadTranslationTable{
  ["th_jufen"] = "俱焚",
  [":th_jufen"] = "出牌阶段，你可以弃置一张牌并横置一名其他角色，若如此做，本阶段结束时，你横置并对自己造成1点火焰伤害。",

  ["#th_jufen"] = "俱焚：弃置一张牌并横置一名其他角色，本阶段结束时，你横置并对自己造成1点火焰伤害",
}

return jufen